import {common, http} from 'src/service/common'

//定义admin涉及到的函数
export default {
  mocklogin: async function (data) {
    return common.datas(await  http.post('/api/admin/customer/mocklogin', data))
  },
  //模版相关操作
  mailTemplates: async function () {
    return common.datas(await  http.get('/api/admin/mail/templates'))
  },
  saveMailTemplate: async function (data) {
    return common.datas(await http.post('/api/admin/mail/template', data))
  },
  //获取模版内容
  mailTemplate: async function (id) {
    return common.datas(await  http.get('/api/admin/mail/template/' + id))
  },
  purchaseDetailAllArrival: async function (data) {
    return common.datas(await  http.post('/api/admin/purchase/detail/allArrival', data))
  },

  purchaseDetailById: async function (id) {
    return common.datas(await http.get('/api/admin/purchase/detail/' + id))
  },

  //商品上架售卖
  purchaseDetailToSell: async function (data) {
    return common.datas(await  http.post('/api/admin/purchase/detail/tosell', data))
  },
  //规格功能
  spec: async function (data) {
    return common.datas(await http.post('/api/admin/spec', data))
  },
  searchSpec: async function (data) {
    return common.datas(await http.post('/api/admin/spec/search', data))
  },
  specByIds: async function (ids) {
    return common.datas(await  http.get('/api/admin/spec/ids/' + ids))
  },
  //快递代码
  searchExpress: async function (data) {
    return common.datas(await http.post('/api/admin/express/search', data))
  }
  ,
  express: async function (data) {
    return common.datas(await http.put('/api/admin/express', data))
  }
  ,
  login: async function (data) {
    return common.datas(await  http.post('/api/admin/login.html', data))
  }
  ,
//获取当前登录用户的信息
  currentUser: async function () {
    return common.datas(await http.get('/api/admin/currentUser'))
  }
  ,
//获取第三方配置
  openAuths: async function () {
    return common.datas(await  http.get('/api/admin/openauth.html'))
  }
  ,
  saveOpenAuth: async function (data) {
    return common.datas(await http.post('/api/admin/openauth.html', data))
  }
  ,

  searchAdmin: async function (data) {
    return common.datas(await http.post('/api/admin/user/search', data))
  }
  ,
//创建系统管理员
  createAdmin: async function (data) {
    return common.datas(await  http.post('/api/admin/user', data))
  }
  ,
//编辑系统管理员
  editAdmin: async function (data) {
    return common.datas(await http.put('/api/admin/user', data))
  },
  lockedAdmin: async function (data) {
    return common.datas(await  http.post('/api/admin/user/locked', data))
  },

//获取用户信息
  admin: async function (id) {
    return common.datas(await http.get('/api/admin/user/' + id))
  }
  ,
//获取系统配置信息
  config: async function (id) {
    return common.datas(await  http.get('/api/admin/config/' + id))
  }
  ,
//更新系统配置信息
  saveConfig: async function (data) {
    return common.datas(await  http.post('/api/admin/config', data))
  }
  ,
//客户信息库
  customer: async function (id) {
    return common.datas(await http.get('/api/admin/customer/' + id))
  },
  lockedCustomer: async function (data) {
    return common.datas(await http.post('/api/admin/customer/locked', data))
  },
//用户列表信息
  customerList: async function (data) {
    return common.datas(await  http.post('/api/admin/customer/search', data))
  },
  memberList: async function (data) {
    return common.datas(await  http.post('/api/admin/customer/member', data))
  },
  customerCreate: async function (data) {
    return common.datas(await  http.post('/api/admin/customer', data))
  },
  customerEdit: async function (data) {
    return common.datas(await http.put('/api/admin/customer', data))
  },
//获取阿里云oss的签名
  aliyunOssPolicy: async function () {
    return common.datas(await http.get('/api/aliyunoss/policy'))
  },

//区域管理代码
  districts: async function (id) {
    return common.datas(await http.get('/api/admin/district/children/' + id))
  }
  ,
  picList: async function (page, size) {
    return common.datas(await  http.get('/api/admin/upload/pic/' + page + '/' + size))
  },
  //brand 处理
  brand: async function (data) {
    return common.datas(await  http.post('/api/admin/brand', data))
  },
  //品牌查询
  brandSearch: async function (data) {
    return common.datas(await  http.post('/api/admin/brand/search', data))
  },

  brandById: async function (id) {
    return common.datas(await  http.get('/api/admin/brand/' + id))
  },

  //修改品牌的显示状态
  brandStatusChange: async function (data) {
    return common.datas(await  http.post('/api/admin/brand/show', data))
  },

  currency: async function () {
    return common.datas(await http.get('/api/admin/currency'))
  },

  //采购单相关操作函数
  purchase: async function (data) {
    return common.datas(await http.post('/api/admin/purchase', data))
  },

  purchaseById: async function (id) {
    return common.datas(await http.get('/api/admin/purchase/' + id))
  },

  purchaseDelete: async function (id) {
    return common.datas(await  http.delete('/api/admin/purchase/' + id))
  },

  searchPurchase: async function (data) {
    return common.datas(await http.post('/api/admin/purchase/search', data))
  },
  purchaseDetailList: async function (id, page, size) {
    return common.datas(await  http.get('/api/admin/purchase/detail/list/' + id + '/' + page + '/' + size))
  },

  searchPurchaseDetail: async function (data) {
    return common.datas(await  http.post('/api/admin/purchase/deatil/search', data))
  },

  purchaseDetail: async function (data) {
    return common.datas(await http.post('/api/admin/purchase/detail/create', data))
  },
  purchaseDetailDelete: async function (id) {
    return common.datas(await http.delete('/api/admin/purchase/detail/' + id))
  },

  deleteOrder: async function (id) {
    return common.datas(await  http.delete('/api/admin/orders/' + id))
  },
  makeUpOrder: async function (data) {
    return common.datas(await  http.post('/api/admin/orders/makeup', data))
  },
  //订单相关操作
  orderCreate: async function (data) {
    return common.datas(await http.post('/api/admin/orders/create', data))
  },
  //查询订单信息
  orderSearch: async function (data) {
    return common.datas(await http.post('/api/admin/orders/search', data))
  },
  debetInfo: async function (data) {
    return common.datas(await http.post('/api/admin/orders/debetinfo', data))
  },
  //变更付款状态
  orderChangePayStatus: async function (data) {
    return common.datas(await  http.post('/api/admin/orders/pay', data))
  },

  //变更到货状态
  orderChangeArrivalStatus: async function (data) {
    return common.datas(await  http.post('/api/admin/orders/arrival', data))
  },
  //变更销售状态
  orderChangeSellStatus: async function (data) {
    return common.datas(await  http.post('/api/admin/orders/sell', data))
  },
  //goodCategory
  goodCategory: async function (id) {
    return common.datas(await http.get('/api/admin/good/category/children/' + id))
  },


  saveCategory: async function (data) {
    return common.datas(await http.post('/api/admin/good/category', data))
  },

  searchSupplies: async function (data) {
    return common.datas(await http.post('/api/admin/supply/search', data))
  },

  saveSupply: async function (data) {
    return common.datas(await http.post('/api/admin/supply', data))
  },
  supply: async function (id) {
    return common.datas(await http.get('/api/admin/supply/' + id))
  },
  changeSupplyShow: async function (data) {
    return common.datas(await  http.post('/api/admin/supply/show', data))
  },

  searchGoodSku: async function (data) {
    return common.datas(await  http.post('/api/admin/good/sku/search', data))
  },
  goodSkuByItemNO: async function (itemNo) {
    return common.datas(await http.get('/api/admin/good/sku/' + itemNo))
  },
  goodById: async function (id) {
    return common.datas(await  http.get('/api/admin/good/' + id))
  },
  searchGood: async function (data) {
    return common.datas(await http.post('/api/admin/good/search', data))
  },
  saveGood: async function (data) {
    return common.datas(await  http.post('/api/admin/good', data))
  },
  //修改商品的显示状态
  changeGoodShow: async function (data) {
    return common.datas(await http.post("/api/admin/good/show", data))
  },
  //查询发布单信息
  searchDelivery: async function (data) {
    return common.datas(await  http.post('/api/admin/delivery/search', data))
  },
  removeDelivery: async function (data) {
    return common.datas(await  http.post('/api/admin/delivery/remove', data))
  },
  //更新发布单快递信息
  updateExpress: async function (data) {
    return common.datas(await http.post('/api/admin/delivery/express', data))
  },

  //催款提醒
  arrearageReminder: async function (data) {
    return common.datas(await http.post('/api/admin/reminder/arrearage', data))
  },
  renameSearch: async function (data) {
    return common.datas(await  http.post('/api/admin/rename/search', data))
  },
  //通过变更名称
  renamePass: async function (data) {
    return common.datas(await http.post('/api/admin/rename/renamed', data))
  },
  //查询退款单
  searchRefund: async function (data) {
    return common.datas(await  http.post('/api/admin/refund/search', data))
  },
  //确认退款单信息
  doneRefund: async function (data) {
    return common.datas(await  http.post('/api/admin/refund/done', data))
  },
  //修改用户密码
  changepassword: async function (data) {
    return common.datas(await http.post('/api/admin/user/changepassword', data))
  },
  userGradeChange: async function (data) {
    return common.datas(await http.post('/api/admin/user/grade', data))
  },
  userGrade: async function () {
    return common.datas(await http.get('/api/admin/grade'))
  },
  saveGrade: async function (data) {
    return common.datas(await  http.post('/api/admin/grade', data))
  },
  webInfo: async function () {
    return common.datas(await http.get('/api/public/site/info'))
  },
}
